home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Icon / c / SetSelect < prev    next >
Text File  |  1995-07-08  |  623b  |  25 lines

  1. #include "DeskLib:Wimp.h"
  2. #include "DeskLib:WimpSWIs.h"
  3. #include "DeskLib:Icon.h"
  4.  
  5.  
  6. extern void Icon_SetSelect(window_handle window, icon_handle icon, int flag)
  7. /* If flag == 0, (and the icon is currently selected) it will be deselected
  8.  * If flag == 1, (and the icon is currently not selected) it will be selected
  9.  */
  10. {
  11.   icon_block istate;
  12.  
  13.   Wimp_GetIconState(window, icon, &istate);
  14.   if (flag)
  15.   {
  16.     if (!istate.flags.data.selected)
  17.       Wimp_SetIconState(window, icon, icon_SELECTED, icon_SELECTED);
  18.   }
  19.   else
  20.   {
  21.     if (istate.flags.data.selected)
  22.       Wimp_SetIconState(window, icon, 0, icon_SELECTED);
  23.   }
  24. }
  25.